admin: Fix various compiler warnings
authorColin Walters <walters@verbum.org>
Sun, 7 Jul 2013 18:30:01 +0000 (14:30 -0400)
committerColin Walters <walters@verbum.org>
Sun, 7 Jul 2013 18:30:01 +0000 (14:30 -0400)
src/ostree/ot-admin-builtin-diff.c
src/ostree/ot-admin-builtin-prune.c
src/ostree/ot-admin-builtin-upgrade.c
src/ostree/ot-admin-deploy.c
src/ostree/ot-admin-functions.c
src/ostree/ot-admin-functions.h

index fd4cd58a5905b50251f5aa21f7c15e4a21c02178..580692e3cc881cdf3b9faaecf9875bf4d23311e7 100644 (file)
@@ -77,7 +77,7 @@ ot_admin_builtin_diff (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, GE
   if (deployment != NULL)
     opt_osname = (char*)ot_deployment_get_osname (deployment);
   if (deployment == NULL)
-    deployment = ot_admin_get_merge_deployment (deployments, opt_osname, deployment, NULL);
+    deployment = ot_admin_get_merge_deployment (deployments, opt_osname, deployment);
   if (deployment == NULL)
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
index 5ee024d4173a32170153f6eab4f879d9d5c46b70..fc062fc6793570de1d52c91c4dbc43be791aeb58 100644 (file)
@@ -41,7 +41,6 @@ ot_admin_builtin_prune (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, G
 {
   GOptionContext *context;
   gboolean ret = FALSE;
-  const char *osname;
   gs_unref_object GFile *repo_path = NULL;
   gs_unref_object GFile *deploy_dir = NULL;
   gs_unref_object GFile *current_deployment = NULL;
@@ -63,8 +62,6 @@ ot_admin_builtin_prune (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, G
       goto out;
     }
 
-  osname = argv[1];
-
   if (!ot_admin_cleanup (admin_opts->sysroot, cancellable, error))
     goto out;
 
index f64837f32698003ac8a66751e8f66d9c66ea2ce3..5663c4fe01c5d40a6dc3e41589d8445907a77ce6 100644 (file)
@@ -89,8 +89,7 @@ ot_admin_builtin_upgrade (int argc, char **argv, OtAdminBuiltinOpts *admin_opts,
   if (!opt_osname)
     opt_osname = (char*)ot_deployment_get_osname (booted_deployment);
   merge_deployment = ot_admin_get_merge_deployment (current_deployments, opt_osname,
-                                                    booted_deployment,
-                                                    NULL);
+                                                    booted_deployment);
 
   deployment_path = ot_admin_get_deployment_directory (admin_opts->sysroot, merge_deployment);
   deployment_origin_path = ot_admin_get_deployment_origin_path (deployment_path);
index 707c8a1c07397fc9242afdd2557838dfa3139b96..5382275b6bad1427847fb5eb9f5701e1527ed2de 100644 (file)
@@ -1087,8 +1087,7 @@ ot_admin_deploy (GFile             *sysroot,
     merge_deployment = g_object_ref (provided_merge_deployment);
   else
     merge_deployment = ot_admin_get_merge_deployment (current_deployments, osname,
-                                                      booted_deployment,
-                                                      new_deployment);
+                                                      booted_deployment); 
 
   compute_new_deployment_list (current_bootversion,
                                current_deployments, osname,
index 5ebeb9c39ec3e281f955ce28d5fc6f56b1c240f4..e97250b3e16914fe447f2134c34946ed398e56d4 100644 (file)
@@ -290,8 +290,8 @@ parse_deployment (GFile           *sysroot,
   const char *relative_boot_link;
   gs_unref_object OtDeployment *ret_deployment = NULL;
   int entry_boot_version;
-  int treebootserial;
-  int deployserial;
+  int treebootserial = -1;
+  int deployserial = -1;
   gs_free char *osname = NULL;
   gs_free char *bootcsum = NULL;
   gs_free char *treecsum = NULL;
@@ -463,8 +463,7 @@ ot_admin_require_deployment_or_osname (GFile               *sysroot,
 OtDeployment *
 ot_admin_get_merge_deployment (GPtrArray         *deployments,
                                const char        *osname,
-                               OtDeployment      *booted_deployment,
-                               OtDeployment      *new_deployment)
+                               OtDeployment      *booted_deployment)
 {
   g_return_val_if_fail (osname != NULL || booted_deployment != NULL, NULL);
 
@@ -472,9 +471,7 @@ ot_admin_get_merge_deployment (GPtrArray         *deployments,
     osname = ot_deployment_get_osname (booted_deployment);
 
   if (booted_deployment &&
-      new_deployment &&
-      g_strcmp0 (ot_deployment_get_osname (booted_deployment),
-                 ot_deployment_get_osname (new_deployment)) == 0)
+      g_strcmp0 (ot_deployment_get_osname (booted_deployment), osname) == 0)
     {
       return g_object_ref (booted_deployment);
     }
@@ -487,8 +484,6 @@ ot_admin_get_merge_deployment (GPtrArray         *deployments,
 
           if (strcmp (ot_deployment_get_osname (deployment), osname) != 0)
             continue;
-          if (deployment == new_deployment)
-            continue;
           
           return g_object_ref (deployment);
         }
index 950d11e7ffcc147819d9a9ce5fcbadda4e0a6009..ad2a932404f0ab7a56bbd6591bd144fc2158c0db 100644 (file)
@@ -96,8 +96,7 @@ gboolean ot_admin_require_deployment_or_osname (GFile               *sysroot,
 
 OtDeployment *ot_admin_get_merge_deployment (GPtrArray         *deployment_list,
                                              const char        *osname,
-                                             OtDeployment      *booted_deployment,
-                                             OtDeployment      *new_deployment);
+                                             OtDeployment      *booted_deployment);
 
 GFile *ot_admin_get_deployment_origin_path (GFile   *deployment_path);